package com.industrial.premu.service.impl;

import java.util.Date;
import java.util.List;

import com.industrial.common.core.utils.StringUtils;
import com.industrial.common.core.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.industrial.premu.mapper.PreMuIndexsManagerMapper;
import com.industrial.premu.domain.PreMuIndexsManager;
import com.industrial.premu.service.IPreMuIndexsManagerService;

/**
 * 指标设置（省级）Service业务层处理
 * 
 * @author ZHOU_S
 * @date 2024-01-22
 */
@Service
public class PreMuIndexsManagerServiceImpl implements IPreMuIndexsManagerService 
{
    @Autowired
    private PreMuIndexsManagerMapper preMuIndexsManagerMapper;

    /**
     * 查询指标设置（省级）
     * 
     * @param baseId 指标设置（省级）主键
     * @return 指标设置（省级）
     */
    @Override
    public PreMuIndexsManager selectPreMuIndexsManagerByBaseId(String baseId)
    {
        return preMuIndexsManagerMapper.selectPreMuIndexsManagerByBaseId(baseId);
    }

    /**
     * 查询指标设置（省级）列表
     * 
     * @param preMuIndexsManager 指标设置（省级）
     * @return 指标设置（省级）
     */
    @Override
    public List<PreMuIndexsManager> selectPreMuIndexsManagerList(PreMuIndexsManager preMuIndexsManager)
    {
        return preMuIndexsManagerMapper.selectPreMuIndexsManagerList(preMuIndexsManager);
    }

    /**
     * 新增指标设置（省级）
     * 
     * @param preMuIndexsManager 指标设置（省级）
     * @return 结果
     */
    @Override
    public int insertPreMuIndexsManager(PreMuIndexsManager preMuIndexsManager)
    {
        preMuIndexsManager.setBaseId(IdUtils.simpleUUID());
        preMuIndexsManager.setBaseCreateTime(new Date());
        return preMuIndexsManagerMapper.insertPreMuIndexsManager(preMuIndexsManager);
    }

    /**
     * 修改指标设置（省级）
     * 
     * @param preMuIndexsManager 指标设置（省级）
     * @return 结果
     */
    @Override
    public int updatePreMuIndexsManager(PreMuIndexsManager preMuIndexsManager)
    {

        return preMuIndexsManagerMapper.updatePreMuIndexsManager(preMuIndexsManager);
    }

    /**
     * 批量删除指标设置（省级）
     * 
     * @param baseIds 需要删除的指标设置（省级）主键
     * @return 结果
     */
    @Override
    public int deletePreMuIndexsManagerByBaseIds(String[] baseIds)
    {
        return preMuIndexsManagerMapper.deletePreMuIndexsManagerByBaseIds(baseIds);
    }

    /**
     * 删除指标设置（省级）信息
     * 
     * @param baseId 指标设置（省级）主键
     * @return 结果
     */
    @Override
    public int deletePreMuIndexsManagerByBaseId(String baseId)
    {
        return preMuIndexsManagerMapper.deletePreMuIndexsManagerByBaseId(baseId);
    }

    /**
     * 分组
     * @param preMuIndexsManager
     * @return
     */
    @Override
    public List<PreMuIndexsManager> groupYears(PreMuIndexsManager preMuIndexsManager) {
        return preMuIndexsManagerMapper.groupYears(preMuIndexsManager);
    }

    /**
     * 查重
     * @param years
     * @param enterType
     * @return
     */
    public boolean booleanPreMuIndexs(String years,String enterType){
        boolean flag=false;
       PreMuIndexsManager preMuIndexsManager=  preMuIndexsManagerMapper.getPreMuIndexs(years,enterType);
        if(preMuIndexsManager!=null){
        }else{
            flag=true;
        }
        return  flag;
    };
}
